package com.huluobo.a2212mdmdemo.demo

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.CheckCircle
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import coil.compose.AsyncImage
import com.huluobo.a2212mdmdemo.R

/**
 *  Created by LC on 2025/5/21.
 */
@Composable
fun MyText() {
    Column(
        horizontalAlignment = Alignment.Start,
        verticalArrangement = Arrangement.SpaceAround
    ) {
        AsyncImage(
            //加载图片的地址
            model = "https://img1.baidu.com/it/u=4214113141,2036563917&fm=253&app=120&size=w931&n=0&f=JPEG&fmt=auto?sec=1729098000&t=0662d2b383091882ccdd43ad060de2a7",
            //图片的描述,一般展示不出来,但是必须得写
            contentDescription = "",
            //装饰器
            modifier = Modifier
                //图片大小
                .size(300.dp)
                //形状裁剪
                .clip(CircleShape),
            //内容裁剪
            contentScale = ContentScale.Crop
        )
        Row {
            Image(
                painter = painterResource(id = R.drawable.ic_launcher_background),
                contentDescription = "", modifier = Modifier
                    .size(300.dp)
                    .clip(CircleShape),
                contentScale = ContentScale.Crop
            )
            Image(imageVector = Icons.Default.CheckCircle, contentDescription = "")
        }
    }
//    Row(
//        modifier = Modifier
//            .fillMaxWidth()
//            .padding(20.dp)
//            .background(Color.Red, RoundedCornerShape(20.dp)),
//        horizontalArrangement = Arrangement.SpaceBetween,
//        verticalAlignment =Alignment.CenterVertically
//    ) {
//        Text(text = "LC")
//        Text(text = "LC")
//        Text(text = "LC")
//        Text(text = "LC")
//        Text(text = "LC")
//        Text(
//            text = "LC", modifier = Modifier.clickable {
//                Log.e("TagA", "点击了Text")
//            }, //文本对齐
//            textAlign = TextAlign.Center,
//            //颜色,2种形式,colorResource 可以直接调用color.xml中的颜色
//            color = colorResource(id = R.color.purple_200),
//            //还可以直接指定颜色
////        color = Color.Black,
//            //字体大小,compose中所有的尺寸比如sp和dp,需要先写值,加点再写sp或者dp
//            fontSize = 22.sp,
//            //字重
//            fontWeight = FontWeight.Bold,
//            //字符间距
////        letterSpacing = 13.sp,
//            //最大行数
//            maxLines = 1,
//            //超出范围后
//            overflow = TextOverflow.Ellipsis
//        )
//    }
}